import {create} from 'zustand'
import {songsType} from "@src/services/music"


export interface PlaylistTrackDataCreateType {
    songsList: Array<songsType>, //歌曲列表
    id: number | null,//歌单ID
    setId: (n: number) => void,
    setSongsList: (item: Array<songsType>) => void,
}

const defaultSong: songsType = {
    id: 2083785152,
    ar: [{id: 7763, name: "G.E.M.邓紫棋"}],
    name: "唯一",
    al: {id: 174925713, picUrl: "https://p1.music.126.net/aJWtwvdYRXvKUpAE2C6NoA==/109951168919708423.jpg"},
    dt: 253735
}


// 播放列表
export const PlaylistTrackDataCreate = create<PlaylistTrackDataCreateType>((set) => ({
    songsList: [defaultSong],
    id: null,
    setId: (n) => set({id: n}),
    setSongsList: (item) => set({songsList: item}),
}))